const { defineConfig } = require('@vue/cli-service')
const path = require('path');

module.exports = defineConfig({
  transpileDependencies: true,
  // 关闭语法检查
  lintOnSave:false,
  configureWebpack: {
    resolve: {
      // 别名
      alias: {
        '@': path.resolve(__dirname, './src'),
        assets: path.resolve(__dirname, './src/assets'),
        components: path.resolve(__dirname, './src/components'),
        style: path.resolve(__dirname, './src/style'),
        utils: path.resolve(__dirname, './src/utils')
      }
    }
  },
  devServer: {
    port: 8667,
    proxy: {
      '/api': {
        target: 'http://localhost:9564',
        changeOrigin: true,             //是否跨域
        ws: true,                       //是否代理 websockets
        secure: true,                   //是否https接口
        pathRewrite: {
          '^/api': ''  // 路径重写
        }
      }
    }
  }
})
